package cc.comac.mom.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRepairRepositoryService;
import cc.comac.mom.bean.EquipRepairRepository;
import cc.comac.mom.datahandlers.entity.EquipRepairRepositoryDataHandler;
import cc.comac.mom.util.ResultBean;

@Service
@RestController(value = "EquipRepairRepositoryController")
@RequestMapping("/equip/repair/repository")
public class EquipRepairRepositoryServiceImpl implements EquipRepairRepositoryService{
	@Autowired
	private EquipRepairRepositoryDataHandler equipRepairRepositoryDataHandler;
	
	@RequestMapping("/save")
	@Override
	public ResultBean save(@RequestBody EquipRepairRepository obj) {
		return equipRepairRepositoryDataHandler.save(obj);
	}
	
	@RequestMapping("/delete")
	@Override
	public ResultBean delete(@RequestBody EquipRepairRepository obj) {
		return equipRepairRepositoryDataHandler.delete(obj);
	}
	
	@RequestMapping("/update")
	@Override
	public ResultBean update(@RequestBody EquipRepairRepository obj) {
		return equipRepairRepositoryDataHandler.update(obj);
	}
	
	@RequestMapping("/saveBatch")
	@Override
	public ResultBean save(@RequestBody List<EquipRepairRepository> list) {
		return equipRepairRepositoryDataHandler.save(list);
	}
	
	@RequestMapping("/updateBatch")
	@Override
	public ResultBean update(@RequestBody List<EquipRepairRepository> list) {
		return equipRepairRepositoryDataHandler.update(list);
	}
	
	@RequestMapping("/deleteBatch")
	@Override
	public ResultBean delete(@RequestBody List<EquipRepairRepository> list) {
		return equipRepairRepositoryDataHandler.delete(list);
	}
	@RequestMapping("/getById/{id}")
	@Override
	public EquipRepairRepository getById(@PathVariable long id) {
		return equipRepairRepositoryDataHandler.getById(id);
	}

}
